package common

//func UnpackArray(s any) []any {
//	v := reflect.ValueOf(s)
//	r := make([]any, v.Len())
//	for i := 0; i < v.Len(); i++ {
//		r[i] = v.Index(i).Interface()
//	}
//	return r
//}

func UnpackArray[S ~[]E, E any](s S) []any {
	r := make([]any, len(s))
	for i, e := range s {
		r[i] = e
	}
	return r
}

func IndexOf(arr []any, target any) (int, bool) {
	for i, e := range arr {
		if e == target {
			return i, true
		}
	}
	return -1, false
}
